package com.example;

import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;

@WebServlet(value = "/",loadOnStartup = 1)
public class HellowServlet implements Servlet{
    public HellowServlet(){
        System.out.println("实例化。。。");
    }

    @Override
    public void init(ServletConfig servletConfig) throws ServletException{
        System.out.println("服务执行初始化方法");
    }

    @Override
    public ServletConfig getServletConfig(){
        return null;
    }

    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException{
        System.out.println("每次请求会执行的方法");
    }

    @Override
    public String getServletInfo(){
        return "";
    }

    @Override
    public void destroy(){
        System.out.println("servlet被销毁了");
    }
}
